//
//  RegisteredView.m
//  Recipe
//
//  Created by YaSha_Tom on 2018/12/17.
//  Copyright © 2018年 YaSha-Tom. All rights reserved.
//

#import "RegisteredView.h"

@implementation RegisteredView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self == [super initWithFrame:frame]) {
        [self initUI];
        self.frame = CGRectMake(0, 0, kSCREEN_WIDTH, kSCREEN_HEIGHT);
    }
    return self;
}
- (void)initUI {

    self.nameFiled = [[TextFileld alloc] init];
    [self.nameFiled setImageName:@"账户" placeholder:@"请输入用户名"];
    [self addSubview:self.nameFiled];
    [self.nameFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.mas_top).offset(200*kHeightScale);
        make.left.mas_equalTo(self.mas_left).offset(25*kWidthScale);
        make.right.mas_equalTo(self.mas_right).offset(-25*kWidthScale);
        make.height.mas_equalTo(50*kHeightScale);
    }];
    
    self.passworkFiled = [[TextFileld alloc] init];
    self.passworkFiled.secureTextEntry = YES;
    self.passworkFiled.returnKeyType = UIReturnKeyGo;
    [self.passworkFiled setImageName:@"密码" placeholder:@"请输入密码"];
    [self addSubview:self.passworkFiled];
    [self.passworkFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.nameFiled.mas_bottom).offset(25*kHeightScale);
        make.left.mas_equalTo(self.mas_left).offset(25*kWidthScale);
        make.right.mas_equalTo(self.mas_right).offset(-25*kWidthScale);
        make.height.mas_equalTo(50*kHeightScale);
    }];

    self.registeredButton = [[UIButton alloc]init];
    [self.registeredButton setTitle:@"注册" forState:UIControlStateNormal];
    self.registeredButton.backgroundColor = [UIColor redColor];
    [self addSubview:self.registeredButton];
    [self.registeredButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.top.mas_equalTo(self.passworkFiled.mas_bottom).offset(50*kHeightScale);
        make.size.mas_equalTo(CGSizeMake(300*kWidthScale, 50*kHeightScale));
    }];
}

@end
